#import "YearningElusiveController.h"
        
#import "YearningElusiveModel.h"
#import "YearningElusiveCell.h"
#import "Masonry.h"

@interface YearningElusiveController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *reverieTableView;
@property (nonatomic, strong) NSMutableArray *glimmerArray;

@end

@implementation YearningElusiveController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self wanderInitlyout];
	[self driftwoodAnticipateloadData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)glimmerArray {
	if (!_glimmerArray) {
		_glimmerArray = [NSMutableArray array];
	}
	return _glimmerArray;
}

- (UITableView *)figHandleTableView {
    if (!_reverieTableView) {
        _reverieTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _reverieTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _reverieTableView.estimatedRowHeight = 0;
        _reverieTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _reverieTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _reverieTableView.delegate = self;
        _reverieTableView.dataSource = self;
        _reverieTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _reverieTableView.showsVerticalScrollIndicator = NO;
        _reverieTableView.showsHorizontalScrollIndicator = NO;
        _reverieTableView.backgroundColor = UIColor.clearColor;
    }
    return _reverieTableView;
}

//: 初始化页面UI
- (void)wanderInitlyout {

	[self.view addSubview:self.reverieTableView];
	[self.reverieTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


//: 获取数据模型
- (void)driftwoodAnticipateloadData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.glimmerArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    YearningElusiveCell *resonateXenophobe = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([YearningElusiveCell class])];
    if (resonateXenophobe == nil) {
        resonateXenophobe = [[YearningElusiveCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([YearningElusiveCell class])];
    }
    resonateXenophobe.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return resonateXenophobe;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
